import request from "@/utils/request";


/**
 * 获取用户信息
 */
export const getUserInfoAPI = () => {
    return request({
        url: "/system/api/user/getUserInfo"
    })
}


/**
 * 退出登录
 * @returns {*}
 */
export const loginOutAPI = () => {
    return request({
        url: "/system/api/user/loginOut"
    })
}


export const findUserByCondAPI = (data) => {
    return request({
        url: "/system/api/user/findUserByCond",
        method: "POST",
        data
    })
}

export function addUser(data) {
    return request({
        url: "/system/api/user/addUser",
        method: 'post',
        params: data
    })
}

// 删除
export function deleteUserByIds(ids) {
    return request({
        url: `/system/api/user/deleteUserByIds/${ids}`,
        method: 'delete',
    })
}


// 重置用户密码
export function resetPwd(userIds,newPassword) {
    return request({
        url: `/system/api/user/resetPwd/${userIds}/${newPassword}`,
        method: 'post'
    })
}

// 查询一个
export function getUserById(id) {
    return request({
        url: `/system/api/user/getUserById/${id}`,
        method: 'post'
    })
}

//修改
export function updateUser(data) {
    return request({
        url: '/system/api/user/updateUser',
        method: 'post',
        data
    })
}

// 判断手机号是否重复
export function userPhone(phone) {
    return request({
        url: `/system/api/user/userPhone/${phone}`,
    })
}